package com.jk.controller;

import com.jk.pojo.OrganizationBean;
import com.jk.service.OrganizationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author jisiqi
 * @version 1.0
 * @description: TODO   机构管理Controller层
 * @date 2022/10/14 14:18
 */
@RestController
@RequestMapping("organization")
public class OrganizationController {

    @Autowired
    private OrganizationService organizationService;

    /** 
     * @description: 查询机构管理MySQL并新增es
     * @param: organizationBean 
     * @return: java.util.Map 
     * @author 纪思齐
     * @date: 2022/10/14 14:28
     */ 
    @RequestMapping("queryOrganizationList")
    public Map  queryOrganizationList(){
        return  organizationService.queryOrganizationList();
    }

    /** 
     * @description: es查询机构管理+高亮
     * @param: organizationBean 
     * @return: java.util.Map 
     * @author 纪思齐
     * @date: 2022/10/14 15:26
     */ 
    @RequestMapping("findEsList")
    public Map findEsList(OrganizationBean organizationBean){
        return  organizationService.findEsList(organizationBean);
    }

    /**
     * @description: 根据机构管理的id删除
     * @param: id
     * @return: boolean
     * @author 纪思齐
     * @date: 2022/10/14 15:41
     */
    @RequestMapping("deleteOrganizationById")
    public  boolean  deleteOrganizationById(@RequestParam Integer id){
        return  organizationService.deleteOrganizationById(id);
    }

    /** 
     * @description:  根据机构id修改状态
     * @param:  
     * @return: boolean 
     * @author 纪思齐
     * @date: 2022/10/18 11:11
     */ 
    @RequestMapping("changeState")
    public  boolean  changeState(Integer organizationId,Integer organizationState){
        return organizationService.changeState(organizationId,organizationState);
    }
}
